package entity.JFrame;

import entity.JPanel.*;

import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.Random;

/**
 * @author Brainrain
 */
public class Detail extends JFrame {
    private Random random = new Random();
    private Color colors[] = {new Color(238, 130, 238), new Color(123, 104, 238), new Color(0, 191, 255), new Color(255, 140, 0),
            new Color(0, 250, 154), new Color(173, 255, 47), new Color(255, 255, 0), new Color(240, 128, 128), new Color(255, 20, 147)};
    //初始化选项卡面板
    private JTabbedPane tabPane = new JTabbedPane();
    BufferedImage bg;
    private int width = Toolkit.getDefaultToolkit().getScreenSize().width;
    private int height = Toolkit.getDefaultToolkit().getScreenSize().height;

    public Detail() {
        //=====Detail=======
        setSize(width, height);
        //窗口居中
        setLocationRelativeTo(null);
        //设置窗口最大化
        setExtendedState(MAXIMIZED_BOTH);
        //设置标题
        setTitle("图书管理系统");
        initComponents();
        setVisible(true);
    }

    public static void main(String[] args) {
        new Detail();
    }

    private void initComponents() {
        //========tabPane======
        add(tabPane, BorderLayout.CENTER);
        tabPane.setBackground(new Color(255, 235, 205));
        tabPane.setForeground(new Color(0, 191, 255));
        tabPane.setFont(new Font("楷体", Font.ITALIC, 30));
        tabPane.setBorder(null);
        tabPane.add("欢迎界面", new WelcomJPanel(width, height));
        tabPane.add("图书查询", new SearchBook(width, height));
        tabPane.add("修改密码", new resetpassword(width, height));
        tabPane.add("借还图书", new Borrow_return(width, height));
        tabPane.add("管理图书", new Book_type());

    }

}

